package com.shop.cloud.service.hongfu.impl;

import java.sql.Timestamp;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shop.cloud.common.mybatis.BaseService;
import com.shop.cloud.common.mybatis.MybatisDao;
import com.shop.cloud.dao.hongfu.TransactionLogDao;
import com.shop.cloud.domain.hongfu.TransactionLog;
import com.shop.cloud.service.hongfu.ITransactionLogService;

/**
 * 
 */
@Service("transactionLogService")
public class TransactionLogService extends BaseService<TransactionLog> implements ITransactionLogService{
    
    @Autowired
	private TransactionLogDao transactionLogDao;

	@Override
	public MybatisDao<TransactionLog> getEntityDao() {
		return transactionLogDao;
	}

	@Override
	public void handleWeixinPay(String tradeNo, float tradeAmount) {
		
		TransactionLog transactionLog = new TransactionLog();
		transactionLog.setType(5);
		transactionLog.setTradeNo(tradeNo);
		transactionLog.setPayType(2);
		transactionLog.setTradeAmount(tradeAmount);
		transactionLog.setContent("微信充值");
		transactionLog.setCreateTime(new Timestamp((new Date()).getTime()));
		transactionLog.setRemark("微信充值");
		
		this.insert(transactionLog);
	}
    
}